// import Toast from './toast.vue'
// const obj={}
// obj.install=function (Vue) {
//     console.log('执行入口文件');
//         //创建组件构造器
//         const toastContrustor=Vue.extend(Toast)
//         //new一个组件对象
//         const toast=new toastContrustor()
//         //将组件对象手动挂载到一个元素上
//         toast.$mount(document.createElement('div'))
//         //toast.$el此时对应就是div
//         document.body.appendChild(toast.$el)
//         Vue.prototype.$toast=toast
// }
// export default obj

import Toast from './2jsonp';
const obj = {};
obj.install = function (Vue) {
  const toastContrustor = Vue.extends(Toast);
  const toast = new toastContrustor();
  toast.$mount(document.createElement('div'));
  document.body.appendChild(toast.$el);
  Vue.prototype.$toast = toast
}

import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store/index.js'
import toast from 'components/common/toast'
// 解决移动端300 延迟
import FastClick from 'fastclick'
// 引入图片懒加载
import lazyload from 'vue-lazyload'
Vue.config.productionTip = false
// 给$bus赋值vue实例才能发射事件
// 兄弟间的事件传递
Vue.prototype.$bus = new Vue()
//安装toast插件
//安装好后,就会调用toast里install方法
import 'assets/css/base.css';
Vue.use(toast)
FastClick.attach(document.body)
Vue.use(lazyload, {
  loading: require('./assets/img/common/placeholder.png')
})
new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')

